package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.tradeapplicationinvoice.LindiTradeApplicationInvoiceQueryVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationinvoice.LindiTradeApplicationInvoiceVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiTradeApplicationInvoiceFeignClientFallbackFactory;

import java.util.List;
import com.minimalist.common.response.R;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 林地指标交易平台_交易申请发票 Feign 客户端
 *
 * @author 11987
 */
@FeignClient(name = "minimalist-lindi"
        , contextId = "lindiTradeApplicationInvoiceFeignClient"
        , path = "/minimalist/lindi/tradeApplicationInvoice"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiTradeApplicationInvoiceFeignClientFallbackFactory.class)
public interface LindiTradeApplicationInvoiceFeignClient{

    /**
     * 添加交易申请发票
     *
     * @param tradeApplicationInvoiceVO 交易申请发票信息
     * @return 成功或失败
     */
    @PostMapping("/addTradeApplicationInvoice")
    @Operation(summary = "添加交易申请发票")
    R<?> addTradeApplicationInvoice(
            @RequestBody @Validated(Add.class)
            LindiTradeApplicationInvoiceVO tradeApplicationInvoiceVO);

    /**
     * 删除交易申请发票 -> 根据交易申请发票ID删除
     *
     * @param tradeApplicationInvoiceId 交易申请发票ID
     * @return 成功或失败
     */
    @DeleteMapping("/deleteTradeApplicationInvoiceByTradeApplicationInvoiceId")
    @Operation(summary = "删除交易申请发票 -> 根据交易申请发票ID删除")
    R<?> deleteTradeApplicationInvoiceByTradeApplicationInvoiceId(
            @RequestParam("tradeApplicationInvoiceId")
            @NotNull(message = "交易申请发票ID不能为空")
            @Parameter(name = "tradeApplicationInvoiceId", required = true, description = "交易申请发票ID")
            Long tradeApplicationInvoiceId);

    /**
     * 修改交易申请发票
     *
     * @param tradeApplicationInvoiceVO 交易申请发票信息
     * @return 成功或失败
     */
    @PutMapping("/updateTradeApplicationInvoiceByTradeApplicationInvoiceId")
    @Operation(summary = "修改交易申请发票")
    R<?> updateTradeApplicationInvoiceByTradeApplicationInvoiceId(
            @RequestBody @Validated(Update.class)
            LindiTradeApplicationInvoiceVO tradeApplicationInvoiceVO);

    /**
     * 查询交易申请发票列表(分页)
     *
     * @param queryVO 查询条件
     * @return 交易申请发票列表
     */
    @GetMapping("/getPageTradeApplicationInvoiceList")
    @Operation(summary = "查询交易申请发票列表(分页)")
    R<PageResp<LindiTradeApplicationInvoiceVO>> getPageTradeApplicationInvoiceList(
            @RequestBody LindiTradeApplicationInvoiceQueryVO queryVO);

    /**
     * 根据交易申请发票ID查询交易申请发票
     *
     * @param tradeApplicationInvoiceId 交易申请发票ID
     * @return 交易申请发票
     */
    @GetMapping("/getTradeApplicationInvoiceByTradeApplicationInvoiceId/{tradeApplicationInvoiceId}")
    @Operation(summary = "根据交易申请发票ID查询交易申请发票")
    R<LindiTradeApplicationInvoiceVO> getTradeApplicationInvoiceByTradeApplicationInvoiceId(
            @PathVariable(value = "tradeApplicationInvoiceId")
            @NotNull(message = "交易申请发票ID不能为空")
            @Parameter(name = "tradeApplicationInvoiceId", description = "交易申请发票ID", required = true)
            Long tradeApplicationInvoiceId);

    /**
     * 根据交易申请ID查询发票列表
     *
     * @param tradeApplicationId 交易申请ID
     * @return 发票列表
     */
    @GetMapping("/getTradeApplicationInvoiceListByTradeApplicationId")
    @Operation(summary = "根据交易申请ID查询发票列表")
    R<List<LindiTradeApplicationInvoiceVO>> getTradeApplicationInvoiceListByTradeApplicationId(
            @RequestParam("tradeApplicationId")
            @NotNull(message = "交易申请ID不能为空")
            @Parameter(name = "tradeApplicationId", description = "交易申请ID", required = true)
            Long tradeApplicationId);
}